'use strict';

angular.module('ProduceWork').controller('CompletePlanListController', ['$scope', 'BaseService', 'PublicModule', 'PublicEnum', 'ProduceWorkEnum', '$location', 'Authentication',
    function($scope, BaseService, PublicModule, PublicEnum, ProduceWorkEnum, $location, Authentication) {
        BaseService.getEnum('ProduceWorkEnum.CompletePlanStatus', function(enumData){
            $scope.StatusEnum = enumData;
        });

    	PublicModule.initModule($scope, 'CompletePlan');
        $scope.Module.CompletePlan.LoadMode = PublicEnum.LoadMode.CacheAndPaging;
        $scope.Module.CompletePlan.Populate = [{path: 'ItemMaster', select: 'Code Name'}];
        $scope.Module.CompletePlan.PageSize = 16;

        $scope.rowDblClick = function(){
            $scope.$apply(function(){
                $location.url("/index/CompletePlan/Edit/" + $scope.Module.CompletePlan.FocusedRecord._id);
            });
        };
    }
]);